<?php
$page_title = "Fifaonline.ro";
include("top.php");
?>

<?php
$post_cat = $_GET['category'];
?>
<h3><font color="#003300"><?php echo $post_cat;?></font></h3>
<?php
require_once ("/includes/mysql_connect.php"); //Realizeaza conexiunea la baza de date.

$query = "SELECT * FROM posts WHERE post_category = '$post_cat' ORDER BY date_written DESC";
$result = @mysql_query($query);


while ($row = mysql_fetch_array($result)) {
	$category = $row['post_category'];
	$postValue = $row['post_id'];
	$filename = 'C:/wamp/www/uploads/'.$postValue.'.jpg';
	if ($category == $post_cat) {
		echo "<h1><a href='newsbyid.php?id=". $postValue ."'>$row[post_title]</a>	</h1>";
		echo "<hr  color='#CCCCCC' width='500px' align='left' />";
		echo "<p class='text1'>";
		if (file_exists($filename))
		{
			echo "<img src='".$filename."' align='right' width='100' height='140'>".$row['post_content']."</p>";
		}
		else
		{
			echo $row['post_content'];
			echo "lk;;;;;</p>";
		}
		echo "<br><br>";
	}
}
?>
<?php
include_once("end.php");
?>
